package cn.itcast.pojo;




import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

public class Book {
    private Integer id;
    private String name;
    private String author;
    private Date time;
    private Integer type;
    public String getFromatTime(){
        if(time!=null){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            String format = sdf.format(time);
            return format;
        }else {
            return "";
        }
    }
    public String getBookMeg(){
        String s="";
        if(type==0){
            s="计算机/软件";
            return s;
        }else if(type==1){
            s="小说/文摘";
            return s;
        }else {
            s="杂项";
            return s;
        }

    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", time=" + time +
                ", type=" + type +
                '}';
    }
}
